package sw6.visualschedule.notification;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

/**
 * Called upon boot completion.
 * Used to start the notification service.
 *
 */
public class Booter extends BroadcastReceiver {

    @Override
    public void onReceive(final Context context, final Intent intent) {
        final String action = intent.getAction();
        
        if (!action.equals(Intent.ACTION_BOOT_COMPLETED)) {
            return;
        }
        
        final Intent serviceIntent = new Intent(context, NotificationService.class);
        context.startService(serviceIntent);
        
        Log.e("onReceive", "Boot completed.");
    }

}
